<?php
/**
 * ajax请求基类
 *
 * @author river_he@eueang.com
 *
 */
class Gospel_Controller_Api extends Gospel_Controller_Abstract {
	/**
	 * 分发Action
	 *
	 * @return void
	 * @throws Gospel_Controller_Exception
	 */
	protected function dispathAction(){
		$action = $this->_req->getAction();
		$action = strtolower($action);
		$action .= 'Action';
		if(method_exists($this, $action)){
			try{
				$this->{$action}();
			}catch(Gospel_Controller_Api_Exception $gcae){
				$gcae->toJson();
			}
		}else{
			throw new Gospel_Controller_Exception('not found the '.$action.' in '.get_class($this), 404);
		}
	}
}
//end
